﻿@using System.Collections.Specialized
@using MvcRags.Examples.Models
@using MvcRags.Filtering
@model IEnumerable<Customer>

@using (Html.BeginFilterForm())
{
<div class="input-append">
    @Html.FilterDropDownForModel()
    @Html.DropDownList("filterMode", new SelectList(new[]
        {
            new { Text = "Contains", Value = "1" },
            new { Text = "Starts With", Value = "2" }
        }, "Value", "Text", ViewBag.SelectedFilterMode))
    @Html.FilterTextboxForModel()
    <button type="submit" class="btn"><i class="icon-search"></i></button>
    <a href="/Filtering" class="btn"><i class="icon-remove"></i></a>
</div>
}

<table class="table table-bordered">
    <thead>
        <tr>
            <th>@Html.DisplayNameFor(model => model.Id)</th>
            <th>@Html.DisplayNameFor(model => model.Name)</th>
            <th>@Html.DisplayNameFor(model => model.Country)</th>
            <th>@Html.DisplayNameFor(model => model.Mail)</th>
            <th>@Html.DisplayNameFor(model => model.Pvn)</th>
            <th>@Html.DisplayNameFor(model => model.CreatedAt)</th>
        </tr>
    </thead>
    <tbody>
        @foreach (Customer item in Model)
        {
            <tr>
                <td>@item.Id</td>
                <td>@item.Name</td>
                <td>@item.Country</td>
                <td>@item.Mail</td>
                <td>@item.Pvn</td>
                <td>@item.CreatedAt</td>
            </tr>
        }
    </tbody>
</table>